import request from '@/util/request'

export function commentAll(page, pageSize, commodityId) {
    return request({
        url: '/comment/all',
        method: 'get',
        params: {
            page: page,
            pageSize: pageSize,
            commodityId: commodityId
        }
    })
}

export function commentAdd(comment) {
    return request({
        url: '/comment/add',
        method: 'post',
        data: {
            content: comment.content,
            commodityId: comment.commodityId,
            starLevel: comment.starLevel
        }
    })
}

export function isComment(commodityId) {
    return request({
        url: '/comment/commented',
        method: 'get',
        params: {
            commodityId: commodityId
        }
    })
}